import api from './api'

/**
 * 统计数据API
 */
export class StatementApi extends api {
  getOrderCount () {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/orderCount`,
      method: 'get'
    })
  }

  getTimeOrderMoney (startDate, endDate, dateFlag) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/timeOrderMoney`,
      method: 'post',
      data: {
        startTime: startDate,
        endTime: endDate
      }
    })
  }

  getUserCount (startDate, endDate, dateFlag) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/userCount`,
      method: 'post',
      data: {
        startTime: startDate,
        endTime: endDate
      }
    })
  }

  getRepairTop10 () {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/repairTop10`,
      method: 'get'
    })
  }
}

export default new StatementApi('platform/statement')
